package com.longge;

public class CountSegments {

    public int countSegments(String s) {
        int count = 0;
        String[] strs = s.split(" ");
        for (String str : strs) {
            if (!str.equals("")){
                count++;
            }
        }
        return count;
    }


}
